package cn.itsource.pethome.quartz;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 定时任务业务处理类
 */
public class MyJob implements Job {

    /**
     * 我的工作
     * @param jobExecutionContext
     * @throws JobExecutionException
     */
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {

        String param = (String) jobExecutionContext.getJobDetail().getJobDataMap().get("param");
        System.out.println(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "            "+param);
    }

}
